<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>动画</title>
    <style>
        body{
            background-color: aqua;
        }
        section{
            width: 1000px;
            height: 500px;
            /*background-color: salmon;*/
            /*border: 2px solid black;*/
            
        }
        div{
            position: absolute;
            
            width: 100px;
            height: 100px;
            background-color: green;
            animation-duration: 1s;
            animation-timing-function: linear;
            /*animation-delay: 2s;*/
            animation-name: move,changecolor;
            animation-fill-mode: backwards;
            animation-iteration-count: infinite;
            border-radius: 50%;
            /*
            动画天聪模式
            *
            backwads:让元素回到动画开始前的状态
            forwards：让元素停留在动画结束是的状态
            both：动画开始前，元素处于动画开始状态
            *
            *
            *
            */
            
        }
        /*div:hover{
            width: 300px;
            height: 300px;
            background-color: saddlebrown;
        }*/


        /*(1)定义动画，秒速过程*/
        /*关键帧动画*/
        @keyframes move{
            0%{
                
                top: 0px;
                left: 0px;


            }
            60%{
                top: 0px;
                /*right: 0px;*/
                left: 800px;


            }
            
            100%{
                /*bottom: 0px;*/
                /*right: 0px;*/
                   top: 300px;
                   left: 800px; 
                }
        }
        @keyframes changecolor{
            0%{
                background-color: saddlebrown;
            }
            20%{
                background-color: seagreen;
            }
            40%{
                background-color: salmon;
            }
            60%{
                background-color: slateblue;
            }
            80%{
                background-color: skyblue;
            }
            100%{
                background-color: slategray;
            }
        }
        #content{
              position: absolute;
            
            width: 100px;
            height: 100px;
            background-color: green;
            animation-duration: 2s;
            animation-timing-function: linear;
            /*animation-delay: 2s;*/
            animation-name: hello,color;
            animation-fill-mode: backwards;
            animation-iteration-count: infinite;
            border-radius: 50%;

        }
           @keyframes hello{
            0%{
                
                top: 0px;
                left: 0px;


            }
            60%{
                top: 0px;
                /*right: 0px;*/
                left: 800px;


            }
            
            100%{
                /*bottom: 0px;*/
                /*right: 0px;*/
                   top: 300px;
                   left: 800px; 
                }
        }
        @keyframes color{
            0%{
                background-color: saddlebrown;
            }
            20%{
                background-color: seagreen;
            }
            40%{
                background-color: salmon;
            }
            60%{
                background-color: slateblue;
            }
            80%{
                background-color: skyblue;
            }
            100%{
                background-color: slategray;
            }
        }
            #fir{
              position: absolute;
            
            width: 100px;
            height: 100px;
            background-color: green;
            animation-duration: 3s;
            animation-timing-function: linear;
            /*animation-delay: 2s;*/
            animation-name: hell,colo;
            animation-fill-mode: backwards;
            animation-iteration-count: infinite;
            border-radius: 50%;

        }
           @keyframes hell{
            0%{
                
                top: 0px;
                left: 0px;


            }
            60%{
                top: 0px;
                /*right: 0px;*/
                left: 800px;


            }
            
            100%{
                /*bottom: 0px;*/
                /*right: 0px;*/
                   top: 300px;
                   
                   left: 800px; 
                }
        }
        @keyframes colo{
            0%{
                background-color: saddlebrown;
            }
            20%{
                background-color: seagreen;
            }
            40%{
                background-color: salmon;
            }
            60%{
                background-color: slateblue;
            }
            80%{
                background-color: skyblue;
            }
            100%{
                background-color: slategray;
            }
        }
            #sec{
              position: absolute;
            
            width: 100px;
            height: 100px;
            background-color: green;
            animation-duration: 4s;
            animation-timing-function: linear;
            /*animation-delay: 2s;*/
            animation-name: ello,olor;
            animation-fill-mode: backwards;
            animation-iteration-count: infinite;
            border-radius: 50%;

        }
           @keyframes ello{
            0%{
                
                top: 0px;
                left: 0px;


            }
            60%{
                top: 0px;
                /*right: 0px;*/
                left: 800px;


            }
            
            100%{
                /*bottom: 0px;*/
                /*right: 0px;*/
                   top: 300px;
                   left: 800px; 
                }
        }
        @keyframes olor{
            0%{
                background-color: saddlebrown;
            }
            20%{
                background-color: seagreen;
            }
            40%{
                background-color: salmon;
            }
            60%{
                background-color: slateblue;
            }
            80%{
                background-color: skyblue;
            }
            100%{
                background-color: slategray;
            }
        }
            #salmon{
              position: absolute;
            
            width: 100px;
            height: 100px;
            background-color: green;
            animation-duration: 5s;
            animation-timing-function: linear;
            /*animation-delay: 2s;*/
            animation-name: helo,coor;
            animation-fill-mode: backwards;
            animation-iteration-count: infinite;
            border-radius: 50%;

        }
           @keyframes helo{
            0%{
                
                top: 0px;
                left: 0px;


            }
            60%{
                top: 0px;
                /*right: 0px;*/
                left: 800px;


            }
            
            100%{
                /*bottom: 0px;*/
                /*right: 0px;*/
                   top: 300px;
                   left: 800px; 
                }
        }
        @keyframes coor{
            0%{
                background-color: saddlebrown;
            }
            20%{
                background-color: seagreen;
            }
            40%{
                background-color: salmon;
            }
            60%{
                background-color: slateblue;
            }
            80%{
                background-color: skyblue;
            }
            100%{
                background-color: slategray;
            }
        }
    </style>
</head>
<body>
    <section>
        <div id="fir"></div>
        <div id="sec"></div>
        <div id="salmon"></div>
        <div id="content"></div>
        <div></div>
    </section>
    
</body>
</html>